home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
games
/
299
/
poker_di.ce
/
pokerdoc.txt
< prev
Wrap
Text File
|
1987-06-22
|
9KB
|
159 lines
Poker Dice
by Mike McCarthy
Poker Dice is a totally mouse-controlled computer adaptation of a popular
board game, in which players roll dice and try to make poker hands out of the
numbers rolled. Poker Dice can be played by one to four players, in high or
medium resolution.
Getting started.
First you must load ST BASIC. If you load TOS from disk, you will need to
disable buffered graphics in order to free up enough memory to enter Poker
Dice. Once you have typed in the program and saved a copy to disk, you're
ready to run it. Select the RUN option on the run menu.
The layout.
The first screen displayed is used to select the number of players. Just
position the mouse cursor on the die with the number corresponding to the
number of players desired, then click the left button once. The dice will be
erased and the game screen will be displayed. Note that BASIC is very slow in
responding to the mouse button; you'll have to hold the button down longer than
you normally would. Do not try to use the scroll bars on the window border!
If you do, the display will be scrambled and you'll have to restart the game.
All game functions are performed by pointing with the mouse and clicking with
the left button. In the upper left corner of the screen is the ROLL command.
Pointing and clicking on this area will roll the dice. The number below ROLL
indicates how many times a player has already rolled the dice during that turn
(each player gets three rolls per turn). Below this is the UNDO command. More
about this feature later. In the upper right of the screen is the NEXT
command. Clicking here will start a new game (regardless of where you are in
the current one). Under NEXT is the QUIT command, which allows you to
terminate a game at any time and return to BASIC.
The rest of the screen is divided into five areas. The ROLL area is at top
center; here the dice are displayed when they are ROLLed. To the far right is
the HOLD area. If a player does not want to roll certain dice during a turn,
they can be held here. The HEADER area is where the PLAYER labels are written;
an arrow points to the player whose turn it currently is. Player scores are
displayed in the SCORE area, the large central portion of the screen. The
OPTION area, containing a list of all the scoring options, is at the left.
The game.
The object of Poker Dice is to score more points than your opponent(s), by
filling in as many scoring options as possible. This requires a certain amount
of skill and a lot of luck.
You begin the game by clicking on the ROLL command. Five randomly rolled dice
will be displayed in the ROLL area. Now you decide which of the scoring
options can best be matched with this combination of dice. You have the option
of rolling all five dice again to get a better result, or of holding some of
the dice in the HOLD area and rolling only the remaining ones. For example, if
you rolled two sixes and three other numbers, the sixes could be placed in the
HOLD area and the remaining dice rolled again, to try to get more sixes to
improve the score. To hold a die, simply point at it and click. It will be
erased and redrawn in the HOLD area. It can be moved back to the ROLL area by
the reverse process. Let's say that you get another six on the second roll.
You would HOLD this six and roll the two remaining dice for the last roll of
the turn. If no more sixes came up, then you would choose your scoring option
at this point. You could choose sixes by pointing to the word SIXES in the
OPTION area and clicking. The score is automatically displayed under the
column header (in high resolution a running total is also displayed at the
bottom of the screen).
If, after you clicked on SIXES, you decided that you would rather score 3 OF A
KIND, you would click on the UNDO command, and the SIXES score would be
removed. You could then click on 3 OF A KIND, and a new score would be
displayed. UNDO can only be used before the next player's first roll. Once
you have clicked on your score (and relinquished the mouse), it is the next
player's turn. The arrow will point to that person's PLAYER header, and the
number of rolls will be reset to 0.
The game continues until each player has filled in all options. You must fill
in one option each turn, and each option can only be filled in once per player
in a game; you cannot add to the score of an option on a subsequent turn. In
some cases, this means that you will be forced to put a 0 in some option(s) if
you were unlucky enough not to match any option, or only matched an option
which already had a score assigned. Determining how best to use each roll is
part of the skill of the game.
When the last player finishes his last turn, Poker Dice calculates the totals,
adds bonuses where applicable, and identifies the player with the highest score
as the winner. The total scores will be displayed on the bottom line of the
screen. At that point, you can click on NEW to start a new game, or on QUIT to
return to BASIC.
The scoring.
Poker Dice calculates all scores and totals for you, but you need to know how
it works to choose your options correctly. For the top six options, the score
is calculated by adding the face value of the dice which match the category
name. For example, to score FOUR, you would add all your FOURs together. Any
dice which are not FOURs are ignored. So three FOURs would yield a score of
12. Four FOURs would be 16. If you were scoring TWOs, then three TWOs would
yield a score of 6, and so on. If the total of a player's top six options is
63 or more (63 is achieved by filling in each option with three dice of the
required value) at the end of the game, then a bonus of 35 points is awarded.
The scores for 3 OF A KIND and 4 OF A KIND are tallied by adding the face
value of all five dice. A FULL HOUSE (two of one kind and three of another) is
always worth 25 points. A SHORT STRAIGHT (at least four consecutive dice, for
example: 2-3-4-5) is always 30 points, a LONG STRAIGHT (five consecutive dice,
for example: 2-3-4-5-6) is always 40 points. A GRAND SLAM (all five dice the
same, for example: 6-6-6-6-6) is always 50 points. The CHOICE option is a
safety valve. You can use it once when you haven't matched anything else.
CHOICE is scored by adding the face value of all five dice.
The program.
The flow of the program is straightforward. The first section dimensions
arrays and initializes all variables. Note that the program chooses between
two complete sets of data statements, depending on the resolution of your
monitor. The next section sets up the initial screen and prompts for the
number of players. Once the number of players is set, the rest of the game
screen is displayed.
The heart of Poker Dice is what I call the "Game Control Loop." Here, the
program waits for you to click the mouse button and, based on the X- and
Y-coordinates of the mouse, calls a subroutine to process the function you
requested (the method for getting the mouse coordinates and button position is
described in Appendix H of the ST BASIC manual). One of the nice features of
ST BASIC is the ability to reference subroutines by name. This makes a program
much easier to read and understand.
The remainder of the program consists of the subroutines to process requests
from the Game Control Loop. The subroutine names and accompanying comments
should provide enough explanation for you to understand the purpose of each.
Enhancements.
Of course, a programmer seldom considers a program finished. There is always
one more feature to include. I would like to make use of the ST's sound
capabilities to make the game a little more lively. Also, saving a running
total of scores over several games would be nice, as well as saving the high
score to disk, and maybe playing against the computer...But rather than never
finish, I decided to leave the game as it is and see what enhancements others
come up with. Whether you attempt some or just play the game, I hope you have
fun in the process.
Author's Biography:
Mike McCarthy, with degrees in History and Computer Systems, has worked on IBM
mainframe computers for ten years. He's currently a database systems analyst
in South Florida. He bought his first Atari (an 800) in 1982 and has enjoyed
experimenting with different programming languages since.
ə